# -*- coding: utf-8 -*-
# @Time : 2021/9/14 14:21
# @Author : hello
# @Email : xxx@gmail.com
# @File : assertionbases.py
# @Project : crm


from selenium.webdriver.common.by import By
from page.crmtest.clueyecz_bases import ClueYeCZ

class Assertion(ClueYeCZ):

    # 断言线索-属性
    msgs = (By.XPATH, '/html/body/div[5]/div[2]')
    msgs1=(By.CSS_SELECTOR,'#tab1 > div.back_box > table > tbody > tr:nth-child(4) > td:nth-child(2) > span')
    #客户
    msgs3 = (By.XPATH, '//*[@id="tab1"]/div[2]/table/tbody/tr[3]/td[4]/span')

    def get_msgs(self):
        """断言提示信息"""
        return self.driver.find_element(*self.msgs).text

    def get_msgs1(self):
        """断言提示信息"""
        return self.driver.find_element(*self.msgs1).text

    # 断言-线索搜索
    def get_msgs2(self):
        for tr in self.clue_table():
            td = tr.find_elements(*self.tds)
            if td[1]:
                return td[1].find_element(*self.a).text

    def get_msgs3(self):
        """断言客户查看提示"""
        return self.driver.find_element(*self.msgs3).text